package com.dek.ioc.context;

import org.junit.Test;

import com.dek.ioc.bean.A;
import com.dek.ioc.bean.B;
import com.dek.ioc.factory.BeanFactory;

public class TestContext {
	@Test
	public void test() {
		BeanFactory bf = new ClassPathXmlApplicationContext("/spring-context.xml");
		A a1 = (A)bf.getBean("A");
		A a2 = (A)bf.getBean("A");
		System.out.println(a1.getName());
		System.out.println(a2.getName());
		B b1 = (B) bf.getBean("B");
		B b2 = (B) bf.getBean("B");
		System.out.println(b1.getA().getName());
		System.out.println(b2.getA().getName());
	}
	
}
